package com.joey.concurrency.example.sync;

import lombok.extern.slf4j.Slf4j;

/**
 * @Author hyy
 **/
@Slf4j
public class ThreadExample {

    public static void main(String[] args) {
        new Thread(){
            public void run(){
                test();
            }
        }.start();

        new Thread(){
            public void run(){
                test();
            }
        }.start();
    }

    public static void test(){
        log.info("start ...");
        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        log.info("end ...");
    }


}
